home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 May / SGI IRIX 6.5 Complementary Applications 2004 May.iso / dist / OpenOffice.idb / usr / OpenOffice / help / en / sbasic.jar / text / sbasic / common / 03020304.xml < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-24  |  2.4 KB  |  39 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <html><head><title>Seek Function [Runtime]</title><meta name="filename" content="text/sbasic/common/03020304"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
  3.  
  4.         p.P1{
  5.                 }
  6.         p.P2{
  7.                 }
  8.         span.T1{
  9.                 font-weight:bold;}
  10.         </style></head><body>
  11.   
  12.   
  13.   <p class="P1"/>
  14.   <p class="Head1"><a name="seek"/><help:link Id="66592" xmlns:help="http://openoffice.org/2000/help">Seek Function [Runtime]</help:link></p>
  15.   <p class="Paragraph">Determines the position for the next writing or reading in a file, which was opened with the open statement. <a name="ende"/>The return valuecorresponds to the value determined by the Seek statement:</p>
  16.   <p class="Paragraph">For random access files, the Seek function returns the number of the next record to be read.</p>
  17.   <p class="Paragraph">For all other files, the function returns the byte position at which the next operation is to occur.</p>
  18.   <p class="Paragraph">See also: <help:link Id="66386" Eid="open" xmlns:help="http://openoffice.org/2000/help">Open</help:link>, <help:link Id="66552" Eid="seek" xmlns:help="http://openoffice.org/2000/help">Seek</help:link>.</p>
  19.   <p class="Paragraph"><span class="T1">Syntax</span>:</p>
  20.   <p class="Paragraph">Seek (FileNumber) <help:key-word value="Seek" tag="kw66592_1" xmlns:help="http://openoffice.org/2000/help"/></p>
  21.   <p class="Paragraph"><span class="T1">Return value</span>:</p>
  22.   <p class="Paragraph">Long</p>
  23.   <p class="Paragraph"><span class="T1">Parameter</span>:</p>
  24.   <p class="Paragraph">FileNumber: Returns the file number determined by the Open statement.</p>
  25.   <p class="P2">Example:</p>
  26.   <p class="PropText">Sub ExampleSeek</p>
  27.   <p class="PropText">Dim i As Integer</p>
  28.   <p class="PropText">Dim iNumber As Integer</p>
  29.   <p class="PropText">iNumber = Freefile</p>
  30.   <p class="PropText">Open "c:\Data.txt" For Random As #iNumber</p>
  31.   <p class="PropText">For i = 1 To 10</p>
  32.   <p class="PropText">PUT #iNumber, , i</p>
  33.   <p class="PropText">Next i</p>
  34.   <p class="PropText">Seek #iNumber, 2</p>
  35.   <p class="PropText">Get #1, , i</p>
  36.   <p class="PropText">Print "Date: "; i;" <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>Next Record: "; Seek(iNumber)</p>
  37.   <p class="PropText">end sub</p>
  38.   <p class="PropText"/>
  39.  </body></html>